{extend name="public/iframe" /}
{block name="top"}
{:load_assets('select2,upload,form','css')}
{/block}
{block name="content"}
<div class="card {eq name='layout' value='dialog'}shadow-none{/eq}">
    <div class="card-body">
        <div class="tab-content">
            <div class="tab-pane fade active show" id="tab1" role="tabpanel">
                <form action="" method="post" id="validate-form">
                    <input type="hidden" name="id" value="{$info.id|default=''}">
                    <input type="hidden" name="type" value="{$info.type|default=''}">
                    <div class="row  mb-sm-3">
                        <label  class="col-xxl-1 col-lg-2 col-sm-3 col-12 col-form-label required">父级</label>
                        <div class="col-xl-4 col-sm-5 col-12 form-item">
                            <select class="form-select" name="pid"  data-control="select2" data-language="zh-CN" data-allow-clear="true" data-placeholder="请选择" data-rule="父级:required">
                                <option value="0">无父级</option>
                                {foreach name="categorys" item="cate"}
                                <option value="{$cate.id}" {eq name="cate.id" value="$info.pid"}selected{/eq} {if $cate.level +1 >= $max_depth}disabled{/if}>{$cate.prefix}{$cate.title}</option>
                                {/foreach}
                            </select>
                        </div>
                    </div>
                    <div class="row  mb-sm-3">
                        <label  class="col-xxl-1 col-lg-2 col-sm-3 col-12 col-form-label required">分类名称</label>
                        <div class="col-lg-10 col-sm-9 col-12 form-item">
                            <input type="text" class="form-control" name="title" value="{$info.title|default=''}" data-rule="分类名称:required;length(~30)">
                        </div>
                    </div>
                    <div class="row  mb-sm-3">
                        <label  class="col-xxl-1 col-lg-2 col-sm-3 col-12 col-form-label">图标</label>
                        <div class="col-lg-10 col-sm-9 col-12 form-item">
                           {:build_upload_template('icon',$info->icon)}
                        </div>
                    </div>
                    <div class="row  mb-sm-3">
                        <label  class="col-xxl-1 col-lg-2 col-sm-3 col-12 col-form-label required">状态</label>
                        <div class="col-lg-10 col-sm-9 col-12 mt-sm-3 form-item">
                            <div class="form-check form-check-custom  form-check-inline">
                                <label class="form-check-label">
                                    <input class="form-check-input w-20px h-20px" type="radio" name="status"  value="1" {eq name="info.status" value="1"}checked{/eq} data-rule="状态:checked"> 启用
                                </label>
                            </div>
                            <div class="form-check  form-check-custom form-check-inline">
                                <label class="form-check-label">
                                    <input class="form-check-input w-20px h-20px" type="radio" name="status"  value="0" {eq name="info.status" value="0"}checked{/eq}> 禁用
                                </label>
                            </div>
                        </div>
                    </div>
                    <div class="row  mb-sm-3">
                        <label  class="col-xxl-1 col-lg-2 col-sm-3 col-12 col-form-label required">排序</label>
                        <div class="col-lg-10 col-sm-9 col-12 form-item">
                            <input type="number" class="form-control" name="sort" value="{$info.sort|default=''}" data-rule="排序:required;integer;range(0~10000)">
                            <div class="form-text text-muted">相同层级，数字越小越排前</div>
                        </div>
                    </div>
                    {include file="public/formfooter" /}
                </form>
            </div>
        </div>
    </div>
</div>
{/block}
{block name="bottom"}
{:load_assets('select2,upload,form','js')}
{/block}